SUBROUTINE BUTTON
*Display a simple form, with one set of fields and a Help button
*When clicked, the button calls a Javascript function to open a new window
*containing some help text

     *Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
     EQU LF TO CHAR(10)
     * Get the URL of the Reality item server
     STYLESHEET = ""
     CALL RW_GET_PARAM("__isurl", STYLESHEET)
     * Specify the location of the stylesheet
     STYLESHEET = STYLESHEET : "/REALWEB-ITEMS/jstyles.css"

     * Start the HTML page
     CALL RW_START_HTML_PAGE("BUTTON", "", STYLESHEET, "", "")
     * Get the JavaScript code
     HELP = ""
     CALL RWA_INSERT_ITEM(HELP, "REALWEB-ITEMS", "help.js")
     * Put the code in the JavaScript buffer
     CALL RW_PUT_EX(HELP, RWD_JAVASCRIPT)

     * Start the HTML form, specifying that the subroutine THANKS2
     * should be run when the form is submitted
     CALL RW_START_HTML_FORM("THANKS2", "FORM7", "")

     LEG_CLASS="legend"
     *Start the fieldset
     CALL RW_START_FIELDSET("")
     BUF="Details of Previous Employment"
     CALL RWS_LEGEND(BUF,LEG_CLASS)
     CALL RW_PUT(BUF)
     * Create the editboxes
     CALL RW_START_PARA("", "")
     CALL RW_PUT(" Employer's Name:     ")
     CALL RW_EDIT_BOX("NAME", 30,"")
     CALL RW_END_PARA
     CALL RW_START_PARA("", "")
     CALL RW_PUT("Employer's Address: ")
     CALL RW_EDIT_BOX("ADD1", 30,"")
     CALL RW_END_PARA
     CALL RW_START_PARA("", "")
     CALL RW_PUT("         ")
     CALL RW_PUT("     ")
     CALL RW_PUT("          ")
     CALL RW_PUT("        ")
     CALL RW_EDIT_BOX("ADD2", 30,"")
     CALL RW_END_PARA
     CALL RW_START_PARA("", "")
     CALL RW_PUT("          ")
     CALL RW_PUT("      ")
     CALL RW_PUT("           ")
     CALL RW_PUT("     ")
     CALL RW_EDIT_BOX("ADD3", 30,"")
     CALL RW_END_PARA
     CALL RW_START_PARA("","")
     CALL RW_PUT("Postcode:         ")
     CALL RW_PUT("        ")
     CALL RW_EDIT_BOX("PCODE", 7,"")
     CALL RW_END_PARA

     *Create the help button
     CALL RW_BUTTON("Info","HELP","return help();","")
     CALL RW_END_FIELDSET

     *Create the submit button
     CALL RW_SUBMIT_BUTTON("Submit","")

     *Complete the form
     CALL RW_END_FORM

     * Complete the page
     CALL RW_END_PAGE
RETURN

Go to top button